package com.wangs.order.controller;

import com.wangs.order.feign.ProductFeignService;
import com.wangs.order.feign.StockFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    StockFeignService stockFeignService;

    @Autowired
    ProductFeignService productFeignService;

    @RequestMapping("/add")
    public String add() {
//        String msg = restTemplate.getForObject("http://localhost:8011/stock/reduce", String.class);
        String msg = stockFeignService.reduce();
        String s = productFeignService.get(1);
        return "hello 添加成功！" + msg + s;
    }
}
